<?php
	/**
	 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
	 * all the essential functionalities required for any enterprise.
	 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
	 *
	 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
	 * the GNU General Public License as published by the Free Software Foundation; either
	 * version 2 of the License, or (at your option) any later version.
	 *
	 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
	 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	 * See the GNU General Public License for more details.
	 *
	 * You should have received a copy of the GNU General Public License along with this program;
	 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
	 * Boston, MA  02110-1301, USA
	 *
	 */

	if ($records['messageType'] == 'SUCCESS') 
	{
		$records['message'] = $lang_Time_Attendance_Import_SUCCESS;
	} 
	elseif ($records['messageType'] == 'FAILURE') 
	{
		$records['message'] = $lang_Time_Attendance_Import_FAILURE;
	} 
	else 
	{
		$records['message'] = null;
	}

	$token = "";
	if(isset($records['token'])) 
	{
		$token = $records['token'];
	}
?>
<div class="formpage">
    <div class="outerbox">
        <div class="mainHeading"><h2><?php echo $lang_Time_Menu_Attendance_Import; ?></h2></div>
<?php 
	if (isset($records['message'])) 
	{ 
?>
		<div class="messagebar">
			<span class="<?php echo $records['messageType']; ?>"><?php echo $records['message']; ?></span>
		</div>
<?php 
	} 
?>

		<form action="?timecode=Time&action=Attendance_Import" method="post" id="attendanceImport" name="attendanceImport">
			<input type="hidden" value="<?php echo $token;?>" name="token" />
			<table width="480" border="0" cellpadding="4" cellspacing="0">
				<tr>
					<td width="50">&nbsp;<?php echo $lang_Time_Attendance_Import_Year; ?></td>
					<td>
						<select id="cmbAttendanceYear" name="cmbAttendanceYear" style="width:125px;" >
<?php
						$attendance_year = "";
						for($counter = -1; $counter <= 1; $counter++)
						{
							$attendance_year = date("Y") + $counter;
							$selected = "";
							if($counter == 0)
								$selected = "selected = 'true'";
							echo "<option value='{$attendance_year}' {$selected}>{$attendance_year}</option>";
						}
?>
						</select>
					</td>
				</tr>
				<tr>
					<td>&nbsp;<?php echo $lang_Time_Attendance_Import_Month; ?></td>
					<td>
						<select id="cmbAttendanceMonth" name="cmbAttendanceMonth" style="width:125px;" >
<?php
						$attendance_month = "";
						$current_month = date("n");
						for($counter = 1; $counter <= 12; $counter++)
						{
							$attendance_month = date('F', mktime(0, 0, 0, $counter));;
							$selected = "";
							if($current_month == $counter)
								$selected = "selected = 'true'";
							echo "<option value='{$counter}' {$selected}>{$attendance_month}</option>";
						}
?>
						</select>						
					</td>
				</tr>
			</table>

			<div class="formbuttons">
				<input type="submit" class="savebutton" id="saveBtn"
					onmouseover="moverButton(this);" onmouseout="moutButton(this);"
					value="<?php echo $lang_Time_Attendance_Import;?>" />
			</div>
		</form>
	</div>
	<script type="text/javascript">
	//<![CDATA[
		if (document.getElementById && document.createElement) 
		{
			roundBorder('outerbox');
		}
	//]]>
	</script>
</div>
